/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.testapp.timemanagment.dao.hibernate;

import com.testapp.timemanagment.dao.AccountDao;
import com.testapp.timemanagment.models.Account;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

/**
 *
 * @author dkozyrev
 */
@Repository("userDao")
public class AccountDaoHibernate extends GenericDaoHibernate<Account, Long> implements AccountDao
{

	@Autowired
    public AccountDaoHibernate(@Qualifier("sessionFactory") SessionFactory sessionFactory)
    {
        super(Account.class);
        setSessionFactory(sessionFactory);
    }

	@Override
	@Transactional
	public void addAccount(Account account) {
		this.getHibernateTemplate().save(account);
	}

	@Override
	public Account getAccountByLogin(String login) {
		throw new UnsupportedOperationException("Not supported yet.");
	}

}
